#ifndef _3DS_H_
#define _3DS_H_
 
#include <string>
#include <string.h>
#include <vector>
#include <iostream>

#include <Stage-4.1/stage.hh>

#include <GL/gl.h>

#include <lib3ds.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

using namespace std;

class Model3DS : public Stg::Model
{
public:

	/* constructors and destructor */
	Model3DS(Stg::World *world, Stg::Pose pose, std::string fname);
	virtual ~Model3DS();
	virtual void DrawBlocks();

	bool loadFromFile(const char * filename);
	bool createLightList();
	void listInstructions(Lib3dsMesh * mesh);
	bool renderNode(Lib3dsNode * node);
	float scale;

private:

	Lib3dsFile *file; /**< file holds the data of the model */
	const char *filename; /**< It's the filename of the model */
	int curFrame; /**< curFrame keeps track of the current frame that shuold be renderd */
	vector<GLuint> textureIndices; /**< this variable holds the texture indicies */
	bool lightEnabled; /**< wheter light was enabled before this class. */
	GLuint lightListIndex;

};

#endif
